//
//  main.m
//  oc4.11
//
//  Created by Mac on 16-4-12.
//  Copyright (c) 2016年 zyl. All rights reserved.
//

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSString *str=@"a,d,c,b";
    NSArray *ano=[str componentsSeparatedByString:@","];
    ano =[ano sortedArrayUsingSelector:@selector(compare:)];
    for(int i=0;i<ano.count;i++){
        NSString *s=ano[i];
        NSLog(@"%d %@",i,s);
    
    }
    
    NSArray *numbers =@[@(1),@(3),@(4),@(2)];
    numbers =[numbers sortedArrayUsingSelector:@selector(compare:)];
    for(int i=0;i<numbers.count;i++){
        NSNumber *s =numbers[i];
        NSLog(@"%d %@",i,s);
    
    }
    return 0;
}

